<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:s="http://jboss.com/products/seam/taglib"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:rich="http://richfaces.org/rich"
    template="layout/template.xhtml">

<ui:define name="body">

    <rich:panel>
        <f:facet name="header">Firma Details</f:facet>

        <s:decorate id="kod" template="layout/display.xhtml">
            <ui:define name="label">Kod</ui:define>
            <h:outputText value="#{firmaHome.instance.kod}"/>
        </s:decorate>

        <s:decorate id="ad" template="layout/display.xhtml">
            <ui:define name="label">Ad</ui:define>
            <h:outputText value="#{firmaHome.instance.ad}"/>
        </s:decorate>

        <s:decorate id="telefon" template="layout/display.xhtml">
            <ui:define name="label">Telefon</ui:define>
            <h:outputText value="#{firmaHome.instance.telefon}"/>
        </s:decorate>
        
        <s:decorate id="adres" template="layout/display.xhtml">
            <ui:define name="label">Adres</ui:define>
            <h:outputText value="#{firmaHome.instance.adres}"/>
        </s:decorate>

        <s:decorate id="eposta" template="layout/display.xhtml">
            <ui:define name="label">Eposta</ui:define>
            <h:outputText value="#{firmaHome.instance.eposta}"/>
        </s:decorate>

        <s:decorate id="webadresi" template="layout/display.xhtml">
            <ui:define name="label">Webadresi</ui:define>
            <h:outputText value="#{firmaHome.instance.webadresi}"/>
        </s:decorate>
        
        <s:decorate id="vergino" template="layout/display.xhtml">
            <ui:define name="label">Vergino</ui:define>
            <h:outputText value="#{firmaHome.instance.vergino}"/>
        </s:decorate>
        
        <s:decorate id="mersisno" template="layout/display.xhtml">
            <ui:define name="label">Mersisno</ui:define>
            <h:outputText value="#{firmaHome.instance.mersisno}"/>
        </s:decorate>

        <div style="clear:both"/>

    </rich:panel>

    <div class="actionButtons">

        <s:button view="/FirmaEdit.xhtml"
                    id="edit"
                 value="Edit"/>

        <s:button view="/#{empty firmaFrom ? 'FirmaList' : firmaFrom}.xhtml"
                    id="done"
                 value="Done"/>

    </div>

    <rich:tabPanel switchType="ajax">

    <rich:tab>
        <f:facet name="label">
            <h:panelGroup><h:graphicImage value="/img/onetomany.gif" style="vertical-align: middle; padding-right: 4px;"/>Isemirs</h:panelGroup>
        </f:facet>
    <h:form styleClass="association" id="isemirsChildren">

        <h:outputText value="There are no isemirs associated with this firma."
                   rendered="#{empty firmaHome.isemirs}"/>

        <rich:dataTable value="#{firmaHome.isemirs}"
                       var="_isemir"
                  rendered="#{not empty firmaHome.isemirs}"
                rowClasses="rvgRowOne,rvgRowTwo"
                        id="isemirsTable">
        <h:column>
            <f:facet name="header">Id</f:facet>
            <h:outputText value="#{_isemir.id}"/>
        </h:column>
        <h:column>
            <f:facet name="header">Isemirno</f:facet>
            <h:outputText value="#{_isemir.isemirno}"/>
        </h:column>
        <h:column rendered="#{authenticator.isAdmin()}">
            <f:facet name="header">Firma id</f:facet>
            <h:outputText value="#{_isemir.firma.ad}"/>
        </h:column>
        <h:column>
            <f:facet name="header">Isemirtarihi</f:facet>
            <h:outputText value="#{_isemir.isemirtarihi}">
                <s:convertDateTime type="date" dateStyle="short"/>
            </h:outputText>
        </h:column>
        <h:column>
            <f:facet name="header">Isletme id</f:facet>
            <h:outputText value="#{_isemir.isletme.ad}"/>
        </h:column>
        <h:column>
            <f:facet name="header">Siparisno</f:facet>
            <h:outputText value="#{_isemir.siparisno}"/>
        </h:column>        
        <h:column>
            <f:facet name="header">Urun id</f:facet>
            <h:outputText value="#{_isemir.urun.urunno} - #{_isemir.urun.adi} ( #{_isemir.urun.kalip.kod} #{_isemir.urun.ambalaj})"/>
        </h:column>        
        <h:column>
            <f:facet name="header">Musteri id</f:facet>
            <h:outputText value="#{_isemir.musteri.ad}"/>
        </h:column>
        <h:column>
            <f:facet name="header">Planlananadet</f:facet>
            <h:outputText value="#{_isemir.planlananadet}"/>
        </h:column>
        <h:column>
            <f:facet name="header">Termintarihi</f:facet>
            <h:outputText value="#{_isemir.termintarihi}">
                <s:convertDateTime type="date" dateStyle="short"/>
            </h:outputText>
        </h:column>
        <h:column>
            <f:facet name="header">Ulke id</f:facet>
            <h:outputText value="#{_isemir.ulke.ad}"/>
        </h:column>
            <h:column>
                <f:facet name="header">Action</f:facet>
                <s:link id="selectisemir"
                     value="Select"
                      view="/Isemir.xhtml">
                    <f:param name="isemirId"
                            value="#{_isemir.id}"/>
                    <f:param name="isemirFrom" value="Firma"/>
                </s:link>
            </h:column>
        </rich:dataTable>

    </h:form>

    <div class="actionButtons">
        <s:button
               value="Add isemir"
                view="/IsemirEdit.xhtml">
            <f:param name="firmaId"
                    value="#{firmaHome.instance.id}"/>
            <f:param name="isemirFrom" value="Firma"/>
        </s:button>
    </div>
    </rich:tab>

    <rich:tab>
        <f:facet name="label">
            <h:panelGroup><h:graphicImage value="/img/onetomany.gif" style="vertical-align: middle; padding-right: 4px;"/>Kalips</h:panelGroup>
        </f:facet>
    <h:form styleClass="association" id="kalipsChildren">

        <h:outputText value="There are no kalips associated with this firma."
                   rendered="#{empty firmaHome.kalips}"/>

        <rich:dataTable value="#{firmaHome.kalips}"
                       var="_kalip"
                  rendered="#{not empty firmaHome.kalips}"
                rowClasses="rvgRowOne,rvgRowTwo"
                        id="kalipsTable">
            <rich:column sortBy="#{_kalip.id}">
                <f:facet name="header">Id</f:facet>
                <h:outputText value="#{_kalip.id}"/>
            </rich:column>
            <rich:column sortBy="#{_kalip.ad}">
                <f:facet name="header">Ad</f:facet>
                <h:outputText value="#{_kalip.ad}"/>
            </rich:column>
            <rich:column sortBy="#{_kalip.agirlik}">
                <f:facet name="header">Agirlik</f:facet>
                <h:outputText value="#{_kalip.agirlik}"/>
            </rich:column>
            <rich:column sortBy="#{_kalip.kod}">
                <f:facet name="header">Kod</f:facet>
                <h:outputText value="#{_kalip.kod}"/>
            </rich:column>
            <rich:column sortBy="#{_kalip.setmi}">
                <f:facet name="header">Setmi</f:facet>
                <h:outputText value="#{_kalip.setmi}"/>
            </rich:column>
            <h:column>
                <f:facet name="header">Action</f:facet>
                <s:link id="selectkalip"
                     value="Select"
                      view="/Kalip.xhtml">
                    <f:param name="kalipId"
                            value="#{_kalip.id}"/>
                    <f:param name="kalipFrom" value="Firma"/>
                </s:link>
            </h:column>
        </rich:dataTable>

    </h:form>

    <div class="actionButtons">
        <s:button
               value="Add kalip"
                view="/KalipEdit.xhtml">
            <f:param name="firmaId"
                    value="#{firmaHome.instance.id}"/>
            <f:param name="kalipFrom" value="Firma"/>
        </s:button>
    </div>
    </rich:tab>

    <rich:tab>
        <f:facet name="label">
            <h:panelGroup><h:graphicImage value="/img/onetomany.gif" style="vertical-align: middle; padding-right: 4px;"/>Kullanicis</h:panelGroup>
        </f:facet>
    <h:form styleClass="association" id="kullanicisChildren">

        <h:outputText value="There are no kullanicis associated with this firma."
                   rendered="#{empty firmaHome.kullanicis}"/>

        <rich:dataTable value="#{firmaHome.kullanicis}"
                       var="_kullanici"
                  rendered="#{not empty firmaHome.kullanicis}"
                rowClasses="rvgRowOne,rvgRowTwo"
                        id="kullanicisTable">
            <rich:column sortBy="#{_kullanici.id}">
                <f:facet name="header">Id</f:facet>
                <h:outputText value="#{_kullanici.id}"/>
            </rich:column>
            <rich:column sortBy="#{_kullanici.ad}">
                <f:facet name="header">Ad</f:facet>
                <h:outputText value="#{_kullanici.ad}"/>
            </rich:column>
            <rich:column sortBy="#{_kullanici.kod}">
                <f:facet name="header">Kod</f:facet>
                <h:outputText value="#{_kullanici.kod}"/>
            </rich:column>
            <rich:column sortBy="#{_kullanici.parola}">
                <f:facet name="header">Parola</f:facet>
                <h:outputText value="#{_kullanici.parola}"/>
            </rich:column>
            <h:column>
                <f:facet name="header">Action</f:facet>
                <s:link id="selectkullanici"
                     value="Select"
                      view="/Kullanici.xhtml">
                    <f:param name="kullaniciId"
                            value="#{_kullanici.id}"/>
                    <f:param name="kullaniciFrom" value="Firma"/>
                </s:link>
            </h:column>
        </rich:dataTable>

    </h:form>

    <div class="actionButtons">
        <s:button
               value="Add kullanici"
                view="/KullaniciEdit.xhtml">
            <f:param name="firmaId"
                    value="#{firmaHome.instance.id}"/>
            <f:param name="kullaniciFrom" value="Firma"/>
        </s:button>
    </div>
    </rich:tab>

    <rich:tab>
        <f:facet name="label">
            <h:panelGroup><h:graphicImage value="/img/onetomany.gif" style="vertical-align: middle; padding-right: 4px;"/>Malzemes</h:panelGroup>
        </f:facet>
    <h:form styleClass="association" id="malzemesChildren">

        <h:outputText value="There are no malzemes associated with this firma."
                   rendered="#{empty firmaHome.malzemes}"/>

        <rich:dataTable value="#{firmaHome.malzemes}"
                       var="_malzeme"
                  rendered="#{not empty firmaHome.malzemes}"
                rowClasses="rvgRowOne,rvgRowTwo"
                        id="malzemesTable">
            <rich:column sortBy="#{_malzeme.id}">
                <f:facet name="header">Id</f:facet>
                <h:outputText value="#{_malzeme.id}"/>
            </rich:column>
            <rich:column sortBy="#{_malzeme.ad}">
                <f:facet name="header">Ad</f:facet>
                <h:outputText value="#{_malzeme.ad}"/>
            </rich:column>
            <rich:column sortBy="#{_malzeme.barkod}">
                <f:facet name="header">Barkod</f:facet>
                <h:outputText value="#{_malzeme.barkod}"/>
            </rich:column>
            <rich:column sortBy="#{_malzeme.kod}">
                <f:facet name="header">Kod</f:facet>
                <h:outputText value="#{_malzeme.kod}"/>
            </rich:column>
            <h:column>
                <f:facet name="header">Action</f:facet>
                <s:link id="selectmalzeme"
                     value="Select"
                      view="/Malzeme.xhtml">
                    <f:param name="malzemeId"
                            value="#{_malzeme.id}"/>
                    <f:param name="malzemeFrom" value="Firma"/>
                </s:link>
            </h:column>
        </rich:dataTable>

    </h:form>

    <div class="actionButtons">
        <s:button
               value="Add malzeme"
                view="/MalzemeEdit.xhtml">
            <f:param name="firmaId"
                    value="#{firmaHome.instance.id}"/>
            <f:param name="malzemeFrom" value="Firma"/>
        </s:button>
    </div>
    </rich:tab>

    <rich:tab>
        <f:facet name="label">
            <h:panelGroup><h:graphicImage value="/img/onetomany.gif" style="vertical-align: middle; padding-right: 4px;"/>Rols</h:panelGroup>
        </f:facet>
    <h:form styleClass="association" id="rolsChildren">

        <h:outputText value="There are no rols associated with this firma."
                   rendered="#{empty firmaHome.rols}"/>

        <rich:dataTable value="#{firmaHome.rols}"
                       var="_rol"
                  rendered="#{not empty firmaHome.rols}"
                rowClasses="rvgRowOne,rvgRowTwo"
                        id="rolsTable">
            <rich:column sortBy="#{_rol.id}">
                <f:facet name="header">Id</f:facet>
                <h:outputText value="#{_rol.id}"/>
            </rich:column>
            <rich:column sortBy="#{_rol.ad}">
                <f:facet name="header">Ad</f:facet>
                <h:outputText value="#{_rol.ad}"/>
            </rich:column>
            <rich:column sortBy="#{_rol.kod}">
                <f:facet name="header">Kod</f:facet>
                <h:outputText value="#{_rol.kod}"/>
            </rich:column>
            <h:column>
                <f:facet name="header">Action</f:facet>
                <s:link id="selectrol"
                     value="Select"
                      view="/Rol.xhtml">
                    <f:param name="rolId"
                            value="#{_rol.id}"/>
                    <f:param name="rolFrom" value="Firma"/>
                </s:link>
            </h:column>
        </rich:dataTable>

    </h:form>

    <div class="actionButtons">
        <s:button
               value="Add rol"
                view="/RolEdit.xhtml">
            <f:param name="firmaId"
                    value="#{firmaHome.instance.id}"/>
            <f:param name="rolFrom" value="Firma"/>
        </s:button>
    </div>
    </rich:tab>

    <rich:tab>
        <f:facet name="label">
            <h:panelGroup><h:graphicImage value="/img/onetomany.gif" style="vertical-align: middle; padding-right: 4px;"/>Uruns</h:panelGroup>
        </f:facet>
    <h:form styleClass="association" id="urunsChildren">

        <h:outputText value="There are no uruns associated with this firma."
                   rendered="#{empty firmaHome.uruns}"/>

        <rich:dataTable value="#{firmaHome.uruns}"
                       var="_urun"
                  rendered="#{not empty firmaHome.uruns}"
                rowClasses="rvgRowOne,rvgRowTwo"
                        id="urunsTable">
            <rich:column sortBy="#{_urun.id}">
                <f:facet name="header">Id</f:facet>
                <h:outputText value="#{_urun.id}"/>
            </rich:column>
            <rich:column sortBy="#{_urun.adi}">
                <f:facet name="header">Adi</f:facet>
                <h:outputText value="#{_urun.adi}"/>
            </rich:column>
            <rich:column sortBy="#{_urun.ambalaj}">
                <f:facet name="header">Ambalaj</f:facet>
                <h:outputText value="#{_urun.ambalaj}"/>
            </rich:column>
            <rich:column sortBy="#{_urun.barkod}">
                <f:facet name="header">Barkod</f:facet>
                <h:outputText value="#{_urun.barkod}"/>
            </rich:column>
            <rich:column sortBy="#{_urun.paletadedi}">
                <f:facet name="header">Paletadedi</f:facet>
                <h:outputText value="#{_urun.paletadedi}"/>
            </rich:column>
            <rich:column sortBy="#{_urun.upc}">
                <f:facet name="header">Upc</f:facet>
                <h:outputText value="#{_urun.upc}"/>
            </rich:column>
            <rich:column sortBy="#{_urun.urunno}">
                <f:facet name="header">Urunno</f:facet>
                <h:outputText value="#{_urun.urunno}"/>
            </rich:column>
            <h:column>
                <f:facet name="header">Action</f:facet>
                <s:link id="selecturun"
                     value="Select"
                      view="/Urun.xhtml">
                    <f:param name="urunId"
                            value="#{_urun.id}"/>
                    <f:param name="urunFrom" value="Firma"/>
                </s:link>
            </h:column>
        </rich:dataTable>

    </h:form>

    <div class="actionButtons">
        <s:button
               value="Add urun"
                view="/UrunEdit.xhtml">
            <f:param name="firmaId"
                    value="#{firmaHome.instance.id}"/>
            <f:param name="urunFrom" value="Firma"/>
        </s:button>
    </div>
    </rich:tab>
</rich:tabPanel>
</ui:define>

</ui:composition>
